<!--  -->
<template>
  <div class="showDataPanel">
    <el-table class="realTableView" :data="dataList" row-key="deviceId">
      <el-table-column prop="rangeName" label="区域名称" align="center"></el-table-column>
      <el-table-column prop="deviceName" label="设备名称" align="center"></el-table-column>
      <el-table-column prop="deviceNo" label="设备编号" align="center"></el-table-column>
      <el-table-column prop="dataTime" label="采集时间" align="center"></el-table-column>
      <el-table-column label="运行时间" align="center">
        <el-table-column label="高档" align="center">
          <el-table-column prop="realActiveEnergyConsumption" label="使用量" align="center"/>
          <el-table-column prop="realActiveEnergyTotal" label="累计值" align="center"/>
        </el-table-column>
        <el-table-column label="中档" align="center">
          <el-table-column prop="realActiveEnergyConsumption" label="使用量" align="center"/>
          <el-table-column prop="realActiveEnergyTotal" label="累计值" align="center"/>
        </el-table-column>
        <el-table-column label="低档" align="center">
          <el-table-column prop="realActiveEnergyConsumption" label="使用量" align="center"/>
          <el-table-column prop="realActiveEnergyTotal" label="累计值" align="center"/>
        </el-table-column>
      </el-table-column>
      <el-table-column prop="qumc" label="阀门开关状态" align="center"></el-table-column>
      <el-table-column prop="qumc" label="供水温度(℃)" align="center"></el-table-column>
    </el-table>
  </div>
</template>

<script>

let component;
import moment from 'moment';

export default {
  watch:{
    async deviceNoList() {
      let response = await component.$asyncPost("data", {
        actionType: "realTimeData",
        deviceInfoList: component.deviceInfoList,
        type:"sampling"
      });
      if(response.success){
        component.dataList = response.dataList;
      }

    }
  },
  data() {
    return {
      deviceInfoList: [],
      deviceNoList: [],
      dataList:[],
      queryParams: {
        dateRange: [moment().subtract(1, 'days'), moment()],
        dateType: 'month'
      }
    };
  },
  methods: {
    getData(data,type) {
      this.queryParams.dateRange = data;
      this.queryParams.dateType=type;
      this.$emit('getData');
    }
  },
  mounted() {
    component = this;
  }
}

</script>
<style lang='scss'>
.test1 {
}
</style>